package com.mapbased.cc.form;

import com.mapbased.wfw.PageLoader;
import org.dom4j.Element;
import java.util.List;
import java.io.IOException;
import com.mapbased.wfw.RenderContext;
import com.mapbased.wfw.Component;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2005</p>
 *
 * <p>Company: mapbased.com</p>
 *
 * @author Chang Huanyou (Baily)
 * @version 1.0
 */
public class CustomFormElement
    extends FormElement
{
    Object[] iuputElements;
    protected void initCustom(Element e,PageLoader.LoadContext lc)
    {
        Element desc=e.element("inputelement");
        if(desc != null)
        {
            PageLoader.LoadContext nlc=new PageLoader.LoadContext(lc);
            PageLoader.StringBufferBag bag=nlc.last;
            List segs=nlc.segments;

          lc.loader.parseElementChildren(desc,nlc);
            if(bag.buffer.length() > 0)
            {
                segs.add(bag.getString());
            }
            this.iuputElements=segs.toArray();

        }


    }
    public void renderInputPart(RenderContext rc)
        throws IOException
    {
	Component.defalutRenderBehavior(rc,this.iuputElements);
    }
}
